package com.itheima.Controller;

import com.itheima.Service.PurchaseService;
import com.itheima.pojo.Purchase;
import com.itheima.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/api/purchaseRequest")
public class PurchaseController {
    @Autowired
    private PurchaseService purchaseService;
    @GetMapping
    private Result getPurchaseRequest(){
        log.info("调用查询所有采购工单");
        List<Purchase> purchaseList = purchaseService.getPurchaseRequestAll();
        return Result.success(purchaseList);
    }

}
